<%--
  Created by IntelliJ IDEA.
  User: zhangjie
  Date: 2018/9/21
  Time: 9:18 AM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/jsp/component/common.jsp" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="${frames}/css/lib/bootstrap.min.css" type="text/css">
    <link rel="stylesheet" href="${frames}/css/lib/dataTables.bootstrap.css" type="text/css">
    <%--<link rel="stylesheet" href="${frames}/css/paginate.css" type="text/css">--%>
    <%--<link rel="stylesheet" href="${frames}/css/qulitity.css" type="text/css">--%>
    <link rel="stylesheet" href="../assets/css/views/modules/_common.scss">
    <link rel="stylesheet" href="${newframe}/css/base/base.css" type="text/css">
    <link rel="stylesheet" href="${assets}/css/views/bloodScreening.css">
    <link rel="stylesheet" href="${assets}/css/views/department/departmentMgr.css">
    <script src="../assets/js/views/vue.min.js"></script>
    <script src="${js}/jquery-1.9.1.min.js"></script>
    <script src="${js}/jquery.dataTables.js"></script>
    <link href="../assets/css/bootstrap-datetimepicker.css" type="text/css">
    <script src="../assets/js/bootstrap-datetimepicker.min.js"></script>
    <script src="${frames}/Chronic/laydate/laydate.js"></script>
    <%-- 时间格式化封装 --%>
    <script src="../assets/js/views/dateChange.js"></script>
    <script src="${assets}/js/views/bpAbnormal.js"></script>
    <%@ include file="/WEB-INF/jsp/component/commonBottom.jsp" %>
    <script type="text/javascript" src="../assets/js/echarts.js"></script>
    <style>
        .color{
            margin:0 !important;
        }
        span{
            font-weight: normal;
            font-stretch: normal;
            letter-spacing: 0px;
            font-family: PingFang-SC-Regular;
        }
        .btn{
            float:right ;
            width:100px;
            font-size:16px;
            line-height:28px;
            background:#35acfd !important;
            margin-right:15px !important;
            padding:0 !important;
        }
        .title{
            font-family: MicrosoftYaHei;
            font-size: 16px !important;
            font-weight: normal;
            font-stretch: normal;
            letter-spacing: 0.3px;
            color: #666666;
        }
        label{
            height: 16px;
            font-family: PingFang-SC-Regular;
            font-size: 16px;
            font-weight: normal;
            font-stretch: normal;
            letter-spacing: 0px;
            color: #666666;
        }
        /* 随访时间及方式 */
        .way,illness,sign,live,evaluate{
            margin-bottom:30px;
        }
        .way_content,illness_content{
            width:100%;
            margin-left:15px;
            margin-top:19px;
        }
        .way_content label{
            width:90px;
        }
        .way_content input,#accompanyType{
            width: 181px;
            line-height: 30px;
            height:30px;
            border: solid 1px #d0d0d0;
            font-family: MicrosoftYaHei;
            font-size: 15px;
            font-weight: normal;
            font-stretch: normal;
            letter-spacing: 0px;
            color: #333333;
            text-indent:10px !important;
        }
        /* 病症 */
        .illness_content{
            margin-left:15px;
            margin-bottom:20px;
        }
        .illness_content label{
            margin-left:22px;
        }
        input[type=checkbox] {
            width:20px;
            height:20px;
            -webkit-appearance: none;
            border-radius:5px;
            border:1px solid #9e9e9e;
            vertical-align:top;
            margin-top:7px;
            display:inline-block !important;
        }
        input[type=checkbox]:checked{
            background-image: url('../assets/images/radio.png');
            background-size:100% 100%;
            border:none
        }
        .ill1{
            margin-right:22px;
            margin-top:20px;
        }
        /* 体征 */
        .sign_content{
            margin-left:15px;
            margin-top:20px;
            margin-bottom:20px;
        }
        .sign_content1{
            margin-left:15px;
            margin-bottom:20px;
        }
        .sign_content1 input{
            width:180px;
            line-height: 30px;
            border: solid 1px #d0d0d0;
            text-indent:10px;
            height:30px;
            display:inline-block;
            margin-left:10px;
        }
        .sign_content div input{
            width:180px;
            line-height: 30px;
            border: solid 1px #d0d0d0;
            text-indent:10px;
            position:absolute;
            height:30px;
            display:inline-block;
            margin-left:10px;
        }
        .sign_content div span{
            position:relative;
            left:130px;
        }
        .sign_content input{
            height: 30px;
            border: solid 1px #d0d0d0;
            line-height:30px;
            margin-right:10px;
            text-indent:10px;
        }
        .sign_content div{
            display:inline-block;
            width:270px;
        }
        .second div input{
            width:115px;
        }
        .second div span{
            left:80px;
        }
        .second div{
            width:200px;
        }
        .third div input{
            width:115px;
        }
        .third div span{
            left:80px;
        }
        .third div{
            width:200px;
        }
        /* 生活方式调查 */
        .live_content{
            margin-left:15px;
            margin-top:20px;
        }
        .live_content span{
            font-family: PingFang-SC-Regular;
            font-size: 16px;
            font-weight: normal;
            font-stretch: normal;
            letter-spacing: 0px;
            color: #666666;
            margin-right:19px;
            display:inline-block;
        }
        .live_content input{
            width: 115px;
            height: 30px;
            border: solid 1px #d0d0d0;
            line-height:30px;
            margin-right:10px;
            text-indent:10px;
        }
        .live_content div{
            margin-top:20px;
        }
        .sprots span{
            margin-right:65px;
        }
        #salt{
            width: 181px;
            height: 30px;
            border: solid 1px #d0d0d0;
            font-family: MicrosoftYaHei;
            font-size: 15px;
            font-weight: normal;
            font-stretch: normal;
            line-height: 30px;
            letter-spacing: 0px;
            color: #333333;
            text-indent:10px;
            margin-right:19px;
        }
        .salt input{
            width: 180px;
            height: 30px;
            border: solid 1px #d0d0d0;
            line-height:30px;
            margin-right:10px;
            text-indent:10px;
        }
        .mentality{
            margin-bottom:20px;
        }
        select{
            width: 181px;
            height: 30px;
            border: solid 1px #d0d0d0;
            font-family: MicrosoftYaHei;
            font-size: 15px;
            font-weight: normal;
            font-stretch: normal;
            line-height: 30px;
            letter-spacing: 0px;
            color: #333333;
            text-indent:10px;
            margin-right:19px;
        }
        .salttype{
            width: 200px;
            height: 30px;
        }
        /* 随访评估 */
        .evaluate_content{
            margin-left:15px;
            margin-bottom:20px;
            margin-top:20px;
        }
        .evaluate_content span{
            font-family: PingFang-SC-Regular;
            font-size: 16px;
            font-weight: normal;
            font-stretch: normal;
            letter-spacing: 0px;
            color: #666666;
            margin-right:19px;
            display:inline-block;
        }
        /* 治疗建议 */
        .suggest_content{
            margin-left:15px;
            margin-bottom:20px;
            margin-top:20px;
        }
        .suggest_content span{
            font-family: PingFang-SC-Regular;
            font-size: 16px;
            font-weight: normal;
            font-stretch: normal;
            letter-spacing: 0px;
            color: #666666;
            margin-right:19px;
            display:inline-block;
        }
        .suggest_content textarea{
            width: 500px;
            height: 120px;
            border: solid 1px #d0d0d0;
            vertical-align:top
        }
        /*  表格 */
        #example th{
            height: 30px;
            background-color: #e6e6e6;
            font-family: MicrosoftYaHei;
            font-size: 16px;
            font-weight: normal;
            font-stretch: normal;
            line-height: 30px;
            letter-spacing: 0px;
            color: #666666;
        }
        #example td{
            text-align:center;
            height: 17px;
            font-family: MicrosoftYaHei;
            font-size: 16px;
            font-weight: normal;
            font-stretch: normal;
            line-height: 30px;
            letter-spacing: 0px;
            color: #333333;
        }
        #mytool{
            width:96%;
        }
        #example_paginate{
            margin-top:15px;
            width:100%;
            text-align: center;
            margin-bottom:40px;
        }
        button{
            margin-top:0px !important;
        }
        .btn{
            font-family: MicrosoftYaHei;
            font-size: 16px;
            font-weight: normal;
            font-stretch: normal;
            letter-spacing: 0.3px;
            color: #ffffff;
        }
        textarea{
            font-family: MicrosoftYaHei;
            font-size: 16px;
            font-weight: normal;
            font-stretch: normal;
            line-height: 30px;
            letter-spacing: 0px;
            color: #333333;
            text-indent:10px;
        }
        input{
            text-indent:10px;
            font-family: MicrosoftYaHei;
            font-size: 16px;
            font-weight: normal;
            font-stretch: normal;
            line-height: 30px;
            letter-spacing: 0px;
            color: #333333;
        }
        .content{
            height:auto !important;
        }
        .illness{
            box-shadow:none !important
        }
        .dataTables_empty{
            line-height:30px;
        }
        .default{
            border:1px solid red !important;
        }
        .title{
            line-height:30px;
            margin-bottom: 5px;
            font-size:16px;
            color:#666666;
        }
    </style>
</head>
<body>
<div>
    <%@ include file="../../breadline.jsp" %>
</div>
<div id="main" class="wrap">
    <div>
        <%@ include file="../../personalnews.jsp" %>
    </div>
    <div class="illness" style="width:99%; margin-right:19px;">
        <div class="tableWrap" style="padding-bottom:20px;background-color: #ffffff;box-shadow: 0 3px 7px 0 rgba(0, 0, 0, 0.05);">
            <div style="margin-left:20px;padding-top:20px;">
                <h3 style="margin-bottom:16px;">随访信息</h3>
            </div>
            <div style="margin-left:19px;margin-bottom:10px;">
                <div class="test" style="border-bottom:1px solid #e6e6e6;">
                    <div style="width:100%;overflow:hidden;margin-bottom:10px;">
                        <span style="width:5px;padding-bottom:25px;background-color:#35acfd;display:inline-block;vertical-align:middle;margin-right:10px;"></span>
                        <span class="title">血糖趋势</span>
                        <button type="button" class="btn btn-info" @click="Morebs()" v-show="xtqs">更多</button>
                    </div>
                    <div class="chart">
                        <p v-show="!chartmain" style="text-align:center;margin:30px 0;">暂无数据</p>
                    </div>
                </div>
            </div>
            <div style="margin-left:19px;">
                <div class="way">
                    <span style="width:5px;padding-bottom:25px;background-color:#35acfd;display:inline-block;vertical-align:middle;margin-right:10px;"></span>
                    <span class="title">随访时间及方式</span>
                    <button type="button" class="btn btn-info" @click="pressure()">
                        <img src="../assets/images/revise.png" alt="" style="width:16px;vertical-align: middle;">  保存
                    </button>
                    <div class="way_content">
                        <div>
                            <label for="">随访日期：</label>
                            <%-- 日期选择器 --%>
                            <div id="PrevTime" class="input-group date form_date" data-date-format="yyyy-mm-dd" style="display:inline-block !important">
                                <input v-model="bpDate.accompanyTime" id="beginDate" type="text" class="lay-date" readonly >
                            </div>
                            <label for="" style="margin-left:40px;">随访方式：</label>
                            <%-- 随访方式 下拉 --%>
                            <select id="accompanyType" name="accompanyType" class="SN">
                                <medi:configOpt name="accompanyType"/>
                            </select>
                        </div>
                        <div style="margin-top:25px;">
                            <%--<label for="">随访医生：</label>--%>
                            <%--&lt;%&ndash; 随访医生 可输入 &ndash;%&gt;--%>
                            <%--<input type="text" placeholder="请输入医生名称" class="doctorId" :value="bpDate.doctorName">--%>
                            <label for="" style="">下次随访：</label>
                            <%-- 下次随访时间 时间选择器 --%>
                            <div id="PrevTime" class="input-group date form_date" data-date-format="yyyy-mm-dd" style="display:inline-block !important">
                                <input v-model="bpDate.nextAccompanyTime" id="nextDate" type="text" class="lay-date" readonly >
                            </div>
                        </div>
                    </div>
                </div>
                <div class="illness">
                    <span style="width:5px;padding-bottom:25px;background-color:#35acfd;display:inline-block;vertical-align:middle;margin-right:10px;"></span>
                    <span class="title">病症</span>
                    <div class="illness_content">
                        <span style="margin-right:26px;margin-top:20px;" class="title">病症选择</span>
                        <div style="display:inline-block;vertical-align: top;width:80%;">
                            <span class="ill1">
                                <input type="checkbox" value="" id="q1"/>
                                <label for="q1">无症状</label>
                            </span>
                            <span class="ill1">
                                <input type="checkbox" value="" id="q2" />
                                <label for="q2">多饮</label>
                            </span>
                            <span class="ill1">
                                <input type="checkbox" value="" id="q3" />
                                <label for="q3">多食</label>
                            </span>
                            <span class="ill1">
                                <input type="checkbox" value="" id="q4"  />
                                <label for="q4">多尿</label>
                            </span>
                            <span class="ill1">
                                <input type="checkbox" value="" id="q5" />
                                <label for="q5">视力模糊</label>
                            </span>
                            <span class="ill1">
                                <input type="checkbox" value="" id="q6"  />
                                <label for="q6">感染</label>
                            </span>
                            <span class="ill1">
                                <input type="checkbox" value="" id="q7" />
                                <label for="q7">手脚麻木</label>
                            </span>
                            <span class="ill1">
                                <input type="checkbox" value="" id="q8" />
                                <label for="q8">下肢浮肿</label>
                            </span>
                            <span class="ill1" style="width:25% !important;">
                                <input type="checkbox" value="" id="q9"  />
                                <label for="q9">体重明显下降</label>
                            </span>
                        </div>
                    </div>
                    <div class="illness_content">
                        <span style="margin-right:60px;margin-top:20px;" class="title">其他</span>
                        <input type="text" style="width: 40%;line-height: 30px;border: solid 1px #d0d0d0;" class="illness_other" v-model="bpDate.otherSymptom">
                    </div>
                </div>
                <div class="sign">
                    <span style="width:5px;padding-bottom:25px;background-color:#35acfd;display:inline-block;vertical-align:middle;margin-right:10px;"></span>
                    <span class="title">体征</span>
                    <div class="sign_content">
                        <div>
                            <label for="">收缩压：</label>
                            <input type="text" class="highPressure" v-model="bpDate.highPressure">
                            <span>mmHg</span>
                        </div>
                        <div>
                            <label for="">舒张压：</label>
                            <input type="text" class="lowPressure" v-model="bpDate.lowPressure">
                            <span>mmHg</span>
                        </div>
                        <div>
                            <label for="">身高</label>
                            <input type="text" class="height" v-model="bpDate.height">
                            <span style="left:160px;">cm</span>
                        </div>
                    </div>
                    <div class="sign_content second">
                        <div>
                            <label for="">体重：</label>
                            <input type="text" class="weight" v-model="bpDate.weight">
                            <span style="left:100px;">kg</span>
                        </div>
                        <div>
                            <label for="">指导：</label>
                            <input type="text" class="weightGuide" v-model="bpDate.weightGuide">
                            <span style="left:100px;">kg</span>
                        </div>
                        <div style="width:220px;">
                            <label for="">体脂指数：</label>
                            <input type="text" class="bmi" v-model="bpDate.bmi">
                            <span>kg/m²</span>
                        </div>
                        <div>
                            <label for="">指导：</label>
                            <input type="text" class="bmiGuide" v-model="bpDate.bmiGuide">
                            <span>kg/m²</span>
                        </div>
                    </div>
                    <div class="sign_content third">
                        <div>
                            <label for="">腰围：</label>
                            <input type="text" class="waist" v-model="bpDate.waistline">
                            <span style="left:100px;">cm</span>
                        </div>
                        <div>
                            <label for="">指导：</label>
                            <input type="text" class="waistGuide" v-model="bpDate.waistlineGuide">
                            <span style="left:100px;">cm</span>
                        </div>
                        <div style="width:350px;">
                            <label for="">足背动脉博动：</label>
                            <select id="footArtery" name="footArtery" class="SN">
                                <medi:configOpt name="footArtery"/>
                            </select>
                        </div>
                    </div>
                    <div class="sign_content">
                        <label style="margin-right:60px;">其他</label>
                        <input type="text" style="width: 40%;line-height: 30px;border: solid 1px #d0d0d0;" class="otherPathological" v-model="bpDate.otherPathological">
                    </div>
                    <div class="sign_content">
                        <label for="" style="margin-right:13px;">血糖类型：</label>
                        <select id="bloodSugarType" name="bloodSugarType" class="SN">
                            <medi:configOpt name="bloodSugarType"/>
                        </select>
                        <label for="" style="margin-right:13px;">血糖值：</label>
                        <input type="text" style="width:181px;" class="bloodSugarValue" v-model="bpDate.bloodSugarValue">
                    </div>
                    <div class="sign_content1">
                        <label for="" style="margin-right:0px;">糖化血红检查日期：</label>
                        <div id="PrevTime" class="input-group date form_date" data-date-format="yyyy-mm-dd" style="display:inline-block !important;margin-right:20px;">
                            <input id="hemoglobinTime" type="text" class="lay-date" placeholder="  选择日期" readonly  v-model="bpDate.hemoglobinTime">
                        </div>
                        <label for="" style="margin-right:0px;">糖化血红蛋白：</label>
                        <input type="text" style="position:absolute;" class="hemoglobin" v-model="bpDate.hemoglobin">
                        <span style="position:relative;left:160px;">%</span>
                    </div>
                    <div class="sign_content">
                        <label style="margin-right:13px;">其他检查：</label>
                        <input type="text" style="width: 40%;line-height: 30px;border: solid 1px #d0d0d0;" class="otherCheck" v-model="bpDate.otherCheck">
                    </div>
                </div>
                <div class="live">
                    <span style="width:5px;padding-bottom:25px;background-color:#35acfd;display:inline-block;vertical-align:middle;margin-right:10px;"></span>
                    <span class="title">生活方式调查与指导</span>
                    <div class="live_content">
                        <div class="first" >
                            <span>日吸烟量（支）</span>
                            <label for="">目前情况：</label>
                            <input type="text" class="smoke" v-model="bpDate.smoke">
                            <label for="">指导：</label>
                            <input type="text" class="smokeGuide" v-model="bpDate.smokeGuide">
                        </div>
                        <div class="first" >
                            <span>日饮酒量（两）</span>
                            <label for="">目前情况：</label>
                            <input type="text" class="drink" v-model="bpDate.drink">
                            <label for="">指导：</label>
                            <input type="text" class="drinkGuide" v-model="bpDate.drinkGuide">
                        </div>
                        <div class="sprots" style="margin-top:5px;">
                            <span>运动情况</span>
                            <label for="">目前情况：</label>
                            <div style="display:inline-block;width:130px;">
                                <input type="text" value="0" style="position:absolute" class="sportsTimes" v-model="bpDate.sportsTimes">
                                <span style="position:relative;left:75px;">次/周</span>
                            </div>
                            <div style="display:inline-block;width:140px;">
                                <input type="text" value="0" style="position:absolute" class="sportsTime" v-model="bpDate.sportsTime">
                                <span style="position:relative;left:62px;">分钟/次</span>
                            </div>
                            <label for="">指导：</label>
                            <div style="display:inline-block;width:140px;">
                                <input type="text" value="0" style="position:absolute" class="sportsTimesGuide" v-model="bpDate.sportsTimesGuide">
                                <span style="position:relative;left:75px;">次/周</span>
                            </div>
                            <div style="display:inline-block;width:140px;">
                                <input type="text" value="0" style="position:absolute" class="sportsTimeGuide" v-model="bpDate.sportsTimeGuide">
                                <span style="position:relative;left:62px;">分钟/次</span>
                            </div>
                        </div>
                        <div class="mentality">
                            <span>心理调整</span>
                            <select id="psychology" name="psychology" class="SN">
                                <medi:configOpt name="psychology"/>
                            </select>
                            <span>遵医行为</span>
                            <select id="observe" name="observe" class="SN">
                                <medi:configOpt name="observe"/>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="evaluate">
                    <span style="width:5px;padding-bottom:25px;background-color:#35acfd;display:inline-block;vertical-align:middle;margin-right:10px;"></span>
                    <span class="title">随访评估</span>
                    <div class="evaluate_content">
                        <span>此次随访分类</span>
                        <select id="accompanyClassify" name="accompanyClassify" class="SN">
                            <medi:configOpt name="accompanyClassify"/>
                        </select>
                    </div>
                </div>
                <div class="suggest">
                    <span style="width:5px;padding-bottom:25px;background-color:#35acfd;display:inline-block;vertical-align:middle;margin-right:10px;"></span>
                    <span class="title">生活方式调查与指导</span>
                    <div class="suggest_content">
                        <span>医生建议</span>
                        <textarea name="suggest" id="" cols="30" rows="10" class="advise">{{bpDate.advise}}</textarea>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div style="width:99%; margin-right:19px;margin-top:20px;" class="content">
        <div style="padding-bottom:20px;background-color: #ffffff;box-shadow: 0 3px 7px 0 rgba(0, 0, 0, 0.05);">
            <div style="margin-left:19px;">
                <div class="first_news">
                    <div class="news" style="margin-top:15px;margin-bottom:16px;">
                        <h3>用药信息</h3>
                        <button type="button" class="btn btn-info" @click="deletMedical()" v-show="!slide" style="margin-top:20px;">删除</button>
                        <button type="button" class="btn btn-info" @click="updateMedical()" style="margin-right:20px;margin-top:20px;">
                            修改
                        </button>
                        <button v-show="!slide" type="button" class="btn btn-info" @click="addMedical()" style="margin-right:20px;margin-top:20px;" >
                            新增
                        </button>
                    </div>
                    <div id="tablepart">
                        <table id="example" class="display" cellspacing="10" width="99%">
                            <thead>
                            <tr>
                                <th style="width:25px;">&nbsp;</th>
                                <th style="width:90px;">序号</th>
                                <th style="display:1%;"></th>
                                <th>药名</th>
                                <th style="width:15%;">数量（剂量）</th>
                                <th>规格</th>
                                <th>频度（次數）</th>
                                <th>用法</th>
                                <th>开立医生</th>
                                <th>开立时间</th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    var vm = new Vue({
        el : "#main",
        data: {
            infor: [],//病人基本信息data
            idCard:'',
            id:'',
            add:false,
            way:'',
            diseasesType:'',
            slide:false,
            beginDate:'',
            nextDate:'',
            bpDate:{
                accompanyTime:'',
                nextAccompanyTime:''
            },
            synchronous:false,
            btnText:'',
            dis:false,
            chartmain:true,
            BsInfo:{
                data:[],
                firstjson:[],
                secondjson:[],
                data1:[]
            },
            xtqs:true
        },
        methods:{
            Morebs:function(){
                let that = this;
                // 显示更多血压信息 跳转
                $.ajax({
                    url:"${URL_SCREENING_GETBREADLINE}",
                    dataType:'json',
                    type:'post',
                    success:function(data){
                        breadLine = JSON.parse(data.data)
                        var url = '${URL_PATIENT_TOMOREBGINFO}?idCard=' + that.infor.idcard + "&bsType=" + that.infor.bsType+'&type='+that.Type
                        breadLine.push({
                            name:'血糖信息',
                            href:url
                        })
                        $.ajax({
                            url:'${URL_SCREENING_SAVEBREADLINE}',
                            data:{
                                breadLine:JSON.stringify(breadLine)
                            },
                            dataType:'json',
                            type:'post',
                            success:function(data){
                                parent.showSrc('${URL_PATIENT_TOMOREBGINFO}?idCard=' + that.infor.idcard + "&bsType=" + that.infor.bsType+'&type='+that.Type)
                            }
                        })
                    }
                })
            },
            //修改病人基本信息
            addDevice : function (){
                let that= this;
                window.parent.showNewModelIframe("${URL_PATIENT_PATIENT}?id="+that.infor.id+'&diseasesType='+that.diseasesType,800,650);
            },
            Synchronous(e){
                let that = this
                $.ajax({
                    url:'${URL_PATIENT_UPDATEPATIENT}',
                    data:{
                        id:that.infor.id,
                        synchronization:'1'
                    },
                    type:'post',
                    dataType:'json',
                    success:function(data){
                        console.log(data)
                        if(data.success){
                            e.target.disabled = true;
                            e.target.innerText = '正在同步'
                            that.setTime()
                        }else{
                            window.parent.showNewModelIframe('${URL_COMMON_TOTIPS}?title='+data.msg,300,200)
                        }
                    }
                })
            },
            setTime(){
                let that = this
                setInterval(function(){
                    $.ajax({
                        url:'${URL_PATIENT_UPDATEPATIENT}',
                        data:{
                            id:that.infor.id,
                            synchronization:'1'
                        },
                        type:'post',
                        dataType:'json',
                        success:function(data){

                        }
                    })
                },10000)
            },
            // 创建table表格
            initTable : function (){
                let that = this;
                var idCard = '${URL_PATIENT_MEDICALINFO}?idCard='+ that.idCard
                table = $('#example').DataTable({
                    "dom": "<'row'<'#mytool.col-xs-10'><'col-xs-6'f>r>" +
                    "t" +
                    "<'row'<''i><''p>>",
                    "bFilter": false,//去掉搜索框
                    "bAutoWidth": true, //自适应宽度
                    "info": false,
                    "bSort": false,
                    "sPaginationType" : "full_numbers",
                    "ordering": false,//是否允许Datatables开启排序
                    "bProcessing" : true,
                    "bServerSide" : true,
                    "searching" : false, //去掉搜索框方法一
                    'lengthChange' : false,
                    "oPaginate":false,
                    "lengthMenu": [10],
                    "sAjaxSource":idCard,
                    "sAjaxDataProp": "list",//查询后，返回的集合
                    "fnServerData": function ( sSource, aoData, fnCallback ) {  //查询条件
                        $.ajax( {
                            "dataType": 'json',
                            "url": sSource,
                            "type":'post',
                            "data": aoData,
                            "success": function(resp){
                                console.log(resp)
                                fnCallback(resp.data)
                            }
                        } );
                    },
                    "aoColumns" : [{
                        "targets": 0,
                        "data": null,
                        "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
                            $(nTd).html('<input class="all_id" type="checkbox">'+'<span style="display:none;">'+ oData.type +'</span>')
                        }

                    },{
                        "targets": 1,
                        "data": null,
                        "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
                            $(nTd).text(oData.id)
                            $(nTd).attr('title',oData.id)
                        }
                    },{
                        "targets": 2,
                        "data": null,
                        "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
                            $(nTd).html('<span style="display:none">'+oData.id+'</span>')
                        }
                    },{
                        "targets": 3,
                        "data": null,
                        "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
                            $(nTd).text(oData.medicalName)
                            $(nTd).attr('title',oData.medicalId)
                        }
                    },{
                        "mDataProp" : "numbers"
                    },{
                        "mDataProp" : "medicalSpecs"
                    },{
                        "mDataProp" : "medicalFrequency"
                    },{
                        "targets": 7,
                        "data": null,
                        "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
                            var doctor;
                            if( oData.useType == 0 ){
                                doctor = `<span title="0">其他</span>`
                            }else if( oData.useType == 1 ){
                                doctor = `<span title="1">口服</span>`
                            }else if( oData.useType == 2 ){
                                doctor = `<span title="2">皮下注射</span>`
                            }else{
                                doctor = '<span title=""></span>'
                            }
                            $(nTd).html(doctor)
                        }
                    },{
                        "targets": 8,
                        "data": null,
                        "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
                            var doctor;
                            if( oData.doctorName == null ){
                                doctor = ""
                            }else{
                                doctor = oData.doctorName
                            }
                            $(nTd).text(doctor)
                        }
                    },{
                        "targets": 9,
                        "data": null,
                        "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
                            if( oData.recordTime != null ){
                                oData.recordTime = oData.recordTime.slice(0,10)
                            }else{
                                oData.recordTime = ''
                            }
                            $(nTd).text(oData.recordTime)
                        }
                    }],
                    "oLanguage": {//插件的汉化
                        "sLengthMenu": "32",
                        "sZeroRecords" : "抱歉， 没有找到",
                        "sInfoEmpty" : "没有数据",
                        "sInfoFiltered" : "(从 _MAX_ 条数据中检索)",
                        "oPaginate" : {
                            "sFirst" : "",
                            "sPrevious" : "<b>上一页<b>",
                            "sLast" : "",
                            "sNext" : "<i>下一页</i>"

                        },
                        "sZeroRecords" : "没有检索到数据",
                        "sProcessing" : "<img src='' />",
                        "sSearch" : "搜索"
                    }
                } )
            },
            addMedical:function(){
                let that = this;
                // 新增用药信息页面 跳转
                // 获取病人id
                window.parent.showNewModelIframe('${URL_PATIENT_TOADDMEDICAL}?id='+that.infor.id + '&idCard=' + that.infor.idcard+'&diseasesType='+that.diseasesType,680,600);
            },
            updateMedical(){
                // 判断是否选中
                let that = this;
                var checkedArray = []
                var input = $('.all_id')
                for( var a = 0; a < input.length; a++ ){
                    if( input[a].checked ){
                        checkedArray.push(input[a])
                    }
                }
                if( checkedArray.length != 1 ){
                    var str = '请勾选一条数据修改'
                    window.parent.showNewModelIframe('${URL_COMMON_TOTIPS}?title='+ encodeURI(encodeURI(str)),380,220)
                }else{
                    var td = checkedArray[0].parentNode.parentNode.childNodes
                    console.log(td)
                    var medicalFrequency = encodeURI(td[6].innerText)
                    var medicalSpecs = encodeURI(td[5].innerText)
                    var numbers = td[4].innerText
                    var id = td[1].title
                    console.log(id)
                    var medicalId = td[3].title
                    var medicalname = encodeURI(td[3].innerText)
                    var recordTime = td[8].innerText;
                    var userType = td[7].children[0].getAttribute('title')
                    window.parent.showNewModelIframe('${URL_PATIENT_TOUPDATEMEDICAL}?id=' + id
                        + '&medicalId=' + medicalId + '&idCard=' + that.idCard + '&medicalFrequency=' + medicalFrequency +
                        '&numbers=' + numbers + '&medicalname=' + medicalname + '&diseasesType='+that.diseasesType+'&recordTime='+recordTime+'&medicalSpecs='+medicalSpecs+'&userType='+userType,800,600);
                }
            },
            deletMedical(){
                let that = this;
                var checkedArray = []
                var input = $('.all_id')
                for( var a = 0; a < input.length; a++ ){
                    if( input[a].checked ){
                        checkedArray.push(input[a])
                    }
                }
                if( checkedArray.length != 1 ){
                    var str = '请勾选一条数据修改'
                    window.parent.showNewModelIframe('${URL_COMMON_TOTIPS}?title='+ encodeURI(encodeURI(str)),380,220)
                }else{
                    var td = checkedArray[0].parentNode.parentNode.childNodes
                    var id = td[1].innerText
                    console.log(id)
                    $.ajax({
                        url:"${URL_PATIENT_DELETEMEDICALINFO}",
                        dataType:'json',
                        type:'post',
                        data:{
                            ids : id
                        },
                        success:function(data){
                            refreshTable();
                        }
                    })
                }
            },
            pressure(){
                let that = this
                // 病症
                var ills = $('.ill1 input')
                var symptom = []
                var app = []
                for( var a = 0 ; a < ills.length; a++ ){
                    if( ills[a].checked ){
                        symptom.push(a+1)
                    }
                }
                symptom = symptom.join(',')
                if( $('#beginDate').val() === "" || $('#nextDate').val() === "" || $('#accompanyType option:selected')[0].value === "" ){
                    if( $('#beginDate').val() === "" ){
                        $('#beginDate').addClass('default')
                        app.push($('#beginDate'))
                    }else{
                        if( $('#beginDate').hasClass('default')){
                            $('#beginDate').removeClass('default')
                        }
                    }
                    if( $('#nextDate').val() === "" ){
                        $('#nextDate').addClass('default')
                        app.push($('#nextDate'))
                    }else{
                        if( $('#nextDate').hasClass('default')){
                            $('#nextDate').removeClass('default')
                        }
                    }
                    if( $('#accompanyType option:selected').attr('value') === "" ){
                        $('#accompanyType').addClass('default')
                        app.push($('#accompanyType'))
                    }else{
                        if( $('#accompanyType').hasClass('default')){
                            $('#accompanyType').removeClass('default')
                        }
                    }
                    if(app[0]){
                        var offset = $(app[0]).offset().top
                        parent.$("html,body").animate({ scrollTop: offset}, 0);
                    }
                }else{
                    $.ajax({
                        url:'${URL_ACCOMPANY_SAVEBS}',
                        dataType:'json',
                        type:'post',
                        data :{
                            // 获取信息数据
                            // 随访时间及方式数据
                            id:that.bpDate.id,
                            symptom:symptom,
                            // 随访日期
                            accompanyTime : $('#beginDate').val(),
                            // 下次随访时间
                            nextAccompanyTime : $('#nextDate').val(),
                            // 随访方式
                            accompanyType : $('#accompanyType option:selected')[0].value,
                            // 其他症状
                            otherSymptom : $('.illness_other').val(),
                            // 体征
                            highPressure : $('.highPressure').val(),
                            // 低压
                            lowPressure : $('.lowPressure').val(),
                            // 身高
                            height : $('.height').val(),
                            // 体重
                            weight : $('.weight').val(),
                            // 体重指导
                            weightGuide : $('.weightGuide').val(),
                            // 体脂
                            bmi : $('.bmi').val(),
                            // 腰围
                            waistline : $('.waist').val(),
                            // 腰围指导
                            waistlineGuide : $('.waistGuide').val(),
                            // 体制指导
                            bmiGuide : $('.bmiGuide').val(),
                            // 血糖值
                            bloodSugarValue : $('.bloodSugarValue').val(),
                            // 血糖类型
                            bloodSugarType : $('#bloodSugarType option:selected')[0].value,
                            // 其他体征
                            otherPathological : $('.otherPathological').val(),
                            // 血糖检测日期
                            hemoglobinTime : $('#hemoglobinTime').val(),
                            // 糖化红血蛋白
                            hemoglobin : $('.hemoglobin').val(),
                            // 吸烟量
                            smoke : $('.smoke').val(),
                            // 吸烟量指导
                            smokeGuide : $('.smokeGuide').val(),
                            // 饮酒量
                            drink : $('.drink').val(),
                            // 饮酒量指导
                            drinkGuide : $('.drinkGuide').val(),
                            // 运动次数
                            sportsTimes : $('.sportsTimes').val(),
                            // 运动时间
                            sportsTime : $('.sportsTime').val(),
                            // 运动次数指导
                            sportsTimesGuide : $('.sportsTimesGuide').val(),
                            // 运动时间指导
                            sportsTimeGuide : $('.sportsTimeGuide').val(),
                            // 辅助检查
                            assistChek : $('.assistChek').val(),
                            // 治疗建议
                            advise : $('.advise').val(),
                            // 心理调整
                            psychology : $('#psychology option:selected')[0].value,
                            // 遵医行为
                            observe : $('#observe option:selected')[0].value,
                            // 随访分类
                            classify : $('#accompanyClassify option:selected')[0].value,
                            idCard : that.idCard,
                            otherCheck:that.bpDate.otherCheck,
                            // 足背动脉博动
                            footArtery :$('#footArtery option:selected')[0].value
                        },
                        success:function(data){
                            if( data.success ){
                                $.ajax({
                                    url:"${URL_SCREENING_GETBREADLINE}",
                                    dataType:'json',
                                    type:'post',
                                    success:function(data){
                                        breadLine = JSON.parse(data.data)
                                        var url = '${URL_ACCOMPANY_BSACCOMPANYS}?idcard=' + that.idCard + '&id=' + that.id +'&diseasesType='+
                                            that.diseasesType
                                        breadLine = breadLine.slice(0,breadLine.length-1)
                                        $.ajax({
                                            url:'${URL_SCREENING_SAVEBREADLINE}',
                                            data:{
                                                breadLine:JSON.stringify(breadLine)
                                            },
                                            dataType:'json',
                                            type:'post',
                                            success:function(data){
                                                parent.showSrc('${URL_ACCOMPANY_BSACCOMPANYS}?idcard=' + that.idCard + '&id=' +
                                                    that.id +'&diseasesType='+ that.diseasesType)
                                            }
                                        })
                                    }
                                })
                            }
                        }
                    })
                }
            }
        },
        mounted() {
            let that = this;
            initLayDate('#beginDate');
            initLayDate('#nextDate')
            initLayDate('#hemoglobinTime')
            var href = location.search.split('?')[1];
            that.idCard = href.split('&')[0].split('=')[1]
            $.ajax({
                url:"${URL_PATIENT_BGREPORT}",
                type:"post",
                dataType:"json",
                data:{
                    idCard:that.idCard
                },
                success:function(data){
                    // 判断数据是否有值
                    if( data.data.list.length == '0' ){
                        // 显示暂无数据
                        that.chartmain = false;
                        that.xtqs = false;
                    }else{
                        that.xtqs = true;
                        // 动态插入 echart dom
                        var str = $("<div></div>")
                        // 添加 id 名称
                        $(str).attr('id','chart');
                        // 插入dom节点内容
                        $(".chart").append(str)
                        // 添加曲线图样式
                        $("#chart").css({
                            'width':"97%",
                            "height": "320px"
                        })
                        // 显示曲线图
                        that.chartmain = true;
                        var dataJosn;
                        var datas = []
                        if( data.data.list.length > 7 ){
                            dataJosn = data.data.list.slice(0,7).reverse()
                        }else{
                            dataJosn = data.data.list.reverse()
                        }
                        // 截取数据长度 部分显示
                        that.BsInfo.firstjson.length = dataJosn.length
                        that.BsInfo.secondjson.length = dataJosn.length
                        for( var a = 0; a < dataJosn.length; a++ ){
                            // 将code为105001的数据添加到新数组中
                            // 获取空腹血压数据
                            // 获取检测时间
                            if( dataJosn[a].testItemCode === '105001' ){
                                that.BsInfo.data.push(dataJosn[a].testValue);
                                that.BsInfo.firstjson[a] = dataJosn[a].testValue;
                            }else if( dataJosn[a].testItemCode === '105002' ){
                                that.BsInfo.data1.push(dataJosn[a].testValue);
                                that.BsInfo.secondjson[a] = dataJosn[a].testValue;
                            }
                            datas.push(dataJosn[a].testTime)
                            // 获取最后一组数据的值 并渲染
                        }
                        // 渲染 echart 曲线图
                        var Chart = echarts.init(document.getElementById('chart'));
                        var select = {
                            'title' : {
                                'text':'血糖(mmHg)',
                                'textStyle':{
                                    'color':'#b0b0b0',
                                    'fontStyle':'normal',
                                    'fontWeight':'lignter',
                                    'fontSize':18
                                }
                            },
                            'tooltip' : {
                                'trigger': 'axis',
                                'formatter' : function (params) {
                                    var str = ''
                                    for( let a = 0; a < params.length; a++ ){
                                        if( params[a].data ){
                                            str += params[a].marker+params[a].seriesName+":"+params[a].data+"<br>"
                                        }
                                    }
                                    if( params.length === '0' ){
                                        str += ""
                                    }else{
                                        params.push({
                                            time : params[0].axisValue
                                        })
                                        str += '检查时间' + ':' + params[params.length-1].time
                                    }
                                    return str
                                }
                            },
                            'calculable' : true,
                            'grid':{
                                'left':'2%',
                                'right':'7%',
                                'top':'10%',
                                'bottom':'5%',
                                'containLabel':true,
                                'y2':50
                            },
                            'xAxis' : [{
                                'type':'category',
                                'boundaryGap' : true,
                                'axisLabel':{'interval': 0},
                                'data':datas,
//                            'boundaryGap':true,'data':datas,
                                'splitNumber':7,
                                'axisLabel':{
                                    'intreval':'auto',
                                    'textStyle':{
                                        'color':'black',
                                        'fontSize':'14'
                                    },
                                    'formatter':function(value){
                                        return value.slice(0,10)
                                    }
                                },
                                'splitLine':{
                                    'show':false
                                },
                                'axisLine':{
                                    'lineStyle':{
                                        'color':'#b6b6b6'
                                    }
                                },
                                'axisTick':{
                                    'show':false
                                }
                            }],
                            'yAxis' : [
                                {
                                    'type':'value',
                                    // 'name':'收缩压',
                                    'max': 15,
                                    'min': 0,
                                    'axisLabel':{
                                        'intreval':0,
                                        'textStyle':{
                                            'color':'black',
                                            'fontSize':'16',
                                            'shadowOffset':-5
                                        }
                                    },
                                    'splitLine' : {
                                        'show' : false
                                    },
                                    'axisLabel' : {
                                        formatter: function(){
                                            return "";
                                        }
                                    },
                                    'axisLine':{
                                        'lineStyle':{
                                            'color':'#b6b6b6'
                                        }
                                    },
                                    'axisTick':{
                                        'show':false
                                    }
                                },
                                {
                                    'type':'value',
                                    'max': 15,
                                    'min': 0,
                                    'splitLine' : {
                                        'show' : false
                                    },
                                    'show':false,
                                    'axisLabel':{
                                        'intreval':0,
                                        'textStyle':{
                                            'color':'black',
                                            'fontSize':'16',
                                            'shadowOffset':-5
                                        }
                                    },
                                    'axisLabel' : {
                                        formatter: function(){
                                            return "";
                                        }
                                    },
                                    'axisLine':{
                                        'lineStyle':{
                                            'color':'#b6b6b6'
                                        }
                                    },
                                    'axisTick':{
                                        'show':false
                                    }
                                }
                            ],
                            'series' : [
                                {
                                    'name':'餐后两小时',
                                    'type':'line',
                                    'markLine':{
                                        'symbol' : 'none',
                                        'symbolSize' : [4, 2],
                                        'itemStyle' : {
                                            'normal': {
                                                'lineStyle': {'color':'red'},
                                                'barBorderColor':'red',
                                                'label':{
                                                    'position':'left',
                                                    // formatter:function(params){
                                                    //     return 100;
                                                    // },
                                                    'textStyle':{'color':'black'}
                                                }
                                            }
                                        },
                                        'data':[
                                            {
                                                'yAxis':4.4,
                                                'name':'4.4',
                                                'itemStyle':{
                                                    'normal':{
                                                        'color':'#3a85ff'
                                                    }
                                                }
                                            }
                                        ]
                                    },
                                    'data': that.BsInfo.secondjson,
                                    'symbol':'circle',
                                    'symbolSize':18,
                                    'itemStyle':{
                                        'normal':{
                                            'color':'#3a85ff',
                                            'lineStyle':{
                                                'color':'#3a85ff'
                                            }
                                        }
                                    }
                                },
                                {
                                    'name':'空腹血糖',
                                    'type':'line',
                                    'markLine':{
                                        'symbol' : 'none',
                                        'symbolSize' : [4, 2],
                                        'itemStyle' : {
                                            'normal': {
                                                'lineStyle': {'color':'red'},
                                                'barBorderColor':'red',
                                                'label':{
                                                    'position':'left',
                                                    'textStyle':{'color':'black'}
                                                }
                                            }
                                        },
                                        'data':[
                                            {
                                                'yAxis':6,
                                                'name':'6',
                                                'itemStyle':{
                                                    'normal':{
                                                        'color':'#3a85ff'
                                                    }
                                                }
                                            },
                                            {
                                                'yAxis':7,
                                                'name':'7',
                                                'itemStyle':{
                                                    'normal':{
                                                        'color':'#3a85ff'
                                                    }
                                                }
                                            },
                                            {
                                                'yAxis':8,
                                                'name':'8',
                                                'itemStyle':{
                                                    'normal':{
                                                        'color':'#3a85ff'
                                                    }
                                                }
                                            },
                                            {
                                                'yAxis':9,
                                                'name':'9',
                                                'itemStyle':{
                                                    'normal':{
                                                        'color':'#3a85ff'
                                                    }
                                                }
                                            },
                                            {
                                                'yAxis':10,
                                                'name':'10',
                                                'itemStyle':{
                                                    'normal':{
                                                        'color':'#3a85ff'
                                                    }
                                                }
                                            },
                                            {
                                                'yAxis':11.1,
                                                'name':'11.1',
                                                'itemStyle':{
                                                    'normal':{
                                                        'color':'#3a85ff'
                                                    }
                                                }
                                            }
                                        ]
                                    },
                                    'data':that.BsInfo.firstjson,
                                    'symbol':'circle',
                                    'symbolSize':18,
                                    'itemStyle':{
                                        'normal':{
                                            'color':'#00d2cb',
                                            'lineStyle':{
                                                'color':'#00d2cb'
                                            }
                                        }
                                    }
                                }
                            ]
                        };
                        Chart.setOption(select);
                        window.addEventListener("resize", function () {
                            Chart.resize();
                        })
                    }
                }
            })
            // 获取当前点击是新增还是修改
            that.way = href.split('&')[1].split('=')[1]
            if( that.way == '' ){
                // 获取上一次的数据
                $.ajax({
                    url:"${URL_PPPATIENTBASE_PATIENTDATA}",
                    type:'get',
                    dataType: "json",
                    data:{
                        idCard:that.idCard
                    },
                    success: function(data) {
                        if( data.data != null ){
                            that.bpDate.bloodFat = data.data.bloodFat;
                            for( let key in data.data ){
                                if( data.data[key] == null ){
                                    data.data[key] = ''
                                }
                            }
                            that.bpDate.highCholesterol = data.data.highCholesterol;
                            that.bpDate.cholesterol = data.data.cholesterol;
                            that.bpDate.lowCholesterol = data.data.lowCholesterol;
                            that.bpDate.bloodSugar = data.data.bloodSugar;
                            that.bpDate.lowPressure = data.data.lowPressure;
                            that.bpDate.highPressure = data.data.highPressure;
                            that.bpDate.triglyceride = data.data.triglyceride;
                            that.bpDate.bmi = data.data.bmi;
                            that.bpDate.waistline = data.data.waist;
                            that.bpDate.weight = data.data.weight;
                            that.bpDate.height = data.data.height;
                            that.bpDate.idCard = data.data.idCard;
                        }
                    }
                })
            }
            // 获取病人基本信息
            $.ajax({
                url:"${URL_PATIENT_PATIENTINFO}",
                type:'post',
                dataType: "json",
                data:{
                    idCard:that.idCard
                },
                success: function(data) {
                    that.infor = data.data;
                    that.id=that.infor.id;
                    var href = that.infor.diseasesType
                    that.infor.diseasesType = Type(that.infor.diseasesType)
                    that.diseasesType = that.infor.diseasesType
                    that.initTable()
                }
            })
            // 初始化获取随访信息
            $.ajax({
                url:"${URL_ACCOMPANY_BSData}",
                type:'post',
                dataType: "json",
                data:{
                    id:that.way
                },
                success: function(data) {
                    if( data.data != null ){
                        console.log(data.data)
                        that.bpDate = data.data
                        var accompanyType = $('#accompanyType option')
                        if( that.bpDate.accompanyTime != null ){
                            that.bpDate.accompanyTime = that.bpDate.accompanyTime.slice(0,10)
                        }
                        if( that.bpDate.nextAccompanyTime != null ){
                            that.bpDate.nextAccompanyTime = that.bpDate.nextAccompanyTime.slice(0,10)
                        }
                        if( that.bpDate.hemoglobinTime != null ){
                            that.bpDate.hemoglobinTime = that.bpDate.hemoglobinTime.slice(0,10)
                        }
                        // 随访方式
                        for( var a = 0; a < accompanyType.length; a++ ){
                            if( accompanyType[a].value == that.bpDate.accompanyType ){
                                accompanyType[a].selected = true
                            }
                        }
                        // 病症选择
                        var ills = $('.ill1 input')
                        var arr = that.bpDate.symptom.split(',')
                        for( var a = 0; a < ills.length; a++ ){
                            for( var  i = 0; i < arr.length; i++  ){
                                if( arr[i] == a+1 ){
                                    ills[a].checked = true
                                }
                            }
                        }
                        // 摄盐程度
                        var salt = $('.salts select option')
                        for( var a = 0; a < salt.length; a++ ){
                            if( salt[a].value == that.bpDate.salt ){
                                salt[a].selected = true
                            }
                        }
                        // 摄盐指导
                        var saltGuide = $('.saltGuide select option')
                        for( var a = 0; a < saltGuide.length; a++ ){
                            if( saltGuide[a].value == that.bpDate.saltGuide ){
                                saltGuide[a].selected = true
                            }
                        }
                        // 心里调整
                        var psychology = $('#psychology option')
                        for( var a = 0; a < psychology.length; a++ ){
                            if( psychology[a].value == that.bpDate.psychology ){
                                psychology[a].selected = true
                            }
                        }
                        // 遵医行为
                        var observe = $('#observe option')
                        for( var a = 0; a < observe.length; a++ ){
                            if( observe[a].value == that.bpDate.observe ){
                                observe[a].selected = true
                            }
                        }
                        // 随访分类
                        var classify = $('#accompanyClassify option')
                        for( var a = 0; a < classify.length; a++ ){
                            if( classify[a].value == that.bpDate.classify ){
                                classify[a].selected = true
                            }
                        }
                        // 足背动脉博动
                        var footArtery = $('#footArtery option')
                        for( var a = 0; a < footArtery.length; a++ ){
                            if( footArtery[a].value == that.bpDate.footArtery ){
                                footArtery[a].selected = true
                            }
                        }
                        // 血糖类型
                        var bloodSugarType = $('#bloodSugarType option')
                        for( var a = 0; a < bloodSugarType.length; a++ ){
                            if( bloodSugarType[a].value == that.bpDate.bloodSugarType ){
                                bloodSugarType[a].selected = true
                            }
                        }
                    }else{
                         var date = new Date().format('yyyy-MM-dd');
                            that.bpDate.accompanyTime = date;
                            // 获取年份
                            var year = date.slice(0,4)
                            // 获取月份
                            var month = date.slice(5,7)
                            if( parseInt(month) + 3 > 12 ){
                                month = parseInt(month) + 3 -12
                                year = parseInt(year) + 1
                            }else{
                                month = parseInt(month) + 3
                            }
                            if( String(month).length <= 1 ){
                                month = '0' + month
                            }
                            // debugger
                            // 获取日期
                            var day = date.slice(8,10);

                            if( parseInt(month) === 2 ){
                                if( parseInt(day) > 28 ){
                                  if (((year % 4)==0) && ((year % 100)!=0) || ((year % 400)==0)) {
                                    day = '29'
                                  }else{
                                    day = '28'
                                }
                              }
                            }else if( parseInt(month) === 4 || parseInt(month) === 6 || parseInt(month) === 9 || parseInt(month) === 11 ){
                                if( parseInt(day) > 30 ){
                                    day = '30';
                                }
                            }
                            var time = year + '-' + month + '-' + day
                        that.bpDate.nextAccompanyTime = time
                    }
                }
            })
        }
    })
</script>
</body>
</html>
